#!/bin/bash

echo "测试织造车间经编机监控系统API..."
echo "=================================="

# 等待应用启动
echo "等待应用启动..."
sleep 15

# 测试获取所有机器状态
echo "1. 测试获取所有机器状态:"
curl -s http://localhost:8080/api/monitor/machines | jq '.[0:2]' 2>/dev/null || curl -s http://localhost:8080/api/monitor/machines | head -10
echo -e "\n"

# 测试获取指定机器状态
echo "2. 测试获取1号机器状态:"
curl -s http://localhost:8080/api/monitor/machines/1 | jq '.' 2>/dev/null || curl -s http://localhost:8080/api/monitor/machines/1
echo -e "\n"

# 测试获取待翻品种计划
echo "3. 测试获取待翻品种计划:"
curl -s http://localhost:8080/api/monitor/pending-plans | jq '.' 2>/dev/null || curl -s http://localhost:8080/api/monitor/pending-plans
echo -e "\n"

echo "API测试完成！"
echo "访问 http://localhost:8080 查看前端界面" 